package com.example.demo.pattern.singleton;

/**
 * 饿汉式
 * 是否 Lazy 初始化：否
 * 是否多线程安全：是
 * 实现难度：易
 * 类加载时就初始化，浪费内存
 *
 */
public class HungerSafeSingleton {
    private static  HungerSafeSingleton instance = new HungerSafeSingleton();

    private HungerSafeSingleton(){}

    public static HungerSafeSingleton getInstance(){
        return instance;
    }

}
